package org.example.new_hbps_backend_reconstruction.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.example.new_hbps_backend_reconstruction.entity.SysMessageEntity;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 丁利军
 * @date 2025年10月11日 21:25
 * @description
 */
@Mapper
public interface SysMessageMapper extends BaseMapper<SysMessageEntity> {



    @Select("SELECT * FROM sys_message WHERE doctor_uid = #{doctorUid} AND message_type = '医生提醒'" +
            "AND sent_date >= #{startDate}")
    List<SysMessageEntity> findRecentMessageByDoctorId(@Param("doctorUid")Long doctorUid, @Param("startDate") LocalDateTime startDate);

}
